package com.gzhryc.shared_device.cdcz.code.dao.db;

import com.gzhryc.common.NumberTools;
import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.JoinField;
import com.gzhryc.jdbc.annotaion.Table;

import java.util.Date;

/**
 * 网点充电插座计费标准
 * @version 2023-02-27
 */
@Table(name="cdcz_fee_template")
public class CDCZFeeTemplate {

    @Id(autoIncrement = 1000)
    @Column(notNull = true, note = "模版ID")
    protected Long id;

    @Column(name="user_id",notNull = true, note = "用户ID")
    protected Long userId;

    @Column(notNull = true,length = 64, note = "模版标题")
    protected String title;

    @Column(name = "time_set_meal", notNull = true, note = "时间套餐")
    protected String timeSetMeal;

    @Column(name = "min_wallet_money",notNull = true,note="钱包最小余额")
    protected Long minWalletMoney;

    @Column(name = "max_charge_times_minute",notNull = true,defVal = "600",note="最大充电时长，单位：分钟")
    protected Integer maxChargeTimesMinute;

    @Column(name = "max_charge_electricity",notNull = true,decimalLen = 3,defVal = "0",note="最大充电电量，单位：千瓦时(wh)")
    protected Double maxChargeElectricity;

    @Column(name = "pim_content", type = "TEXT", notNull = true, note = "powerIntervalMoney内容（功率收费标准）")
    protected String pimContent;

    @Column(name = "update_date", autoUpdateTime = true, note = "最后修改时间")
    protected Date updateDate;

    @Column(name = "create_date")
    protected Date createDate;

    @JoinField(name = "name", fromField = "user_id", toTable = "user_info",type="LEFT")
    protected String userName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPimContent() {
        return pimContent;
    }

    public void setPimContent(String pimContent) {
        this.pimContent = pimContent;
    }

    public Long getMinWalletMoney() {
        return minWalletMoney;
    }

    public void setMinWalletMoney(Long minWalletMoney) {
        this.minWalletMoney = minWalletMoney;
    }

    public Integer getMaxChargeTimesMinute() {
        return maxChargeTimesMinute;
    }

    public void setMaxChargeTimesMinute(Integer maxChargeTimesMinute) {
        this.maxChargeTimesMinute = maxChargeTimesMinute;
    }

    public Double getMaxChargeElectricity() {
        return maxChargeElectricity;
    }

    public void setMaxChargeElectricity(Double maxChargeElectricity) {
        this.maxChargeElectricity = maxChargeElectricity;
    }

    public String getTimeSetMeal() {
        return timeSetMeal;
    }

    public void setTimeSetMeal(String timeSetMeal) {
        this.timeSetMeal = timeSetMeal;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getMinWalletMoneyStr(){
        return NumberTools.getMoneyLiStr(this.minWalletMoney);
    }

    public String getFeeInfo(){
        String msg = "钱包最小金额" + this.getMinWalletMoneyStr() + "元";
        msg = msg + ",服务时长(小时):" + this.getTimeSetMeal();
        return msg;
    }
}
